/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';

const { ctxPath, adminPath } = useGlobSetting();

export interface CoreClwxjl extends BasicModel<CoreClwxjl> {
  clwxjlCph?: string; // 车牌号
  clwxjlPpxh?: string; // 品牌型号
  clwxjlClsbdh?: string; // 车辆识别代号
  clwxjlFdjhm?: string; // 发动机号码
  clwxjlWxrq?: string; // 维修日期
  clwxjlSxr?: string; // 送修人
  clwxjlWxyy?: string; // 维修原因
  clwxjlWxdw?: string; // 维修单位
  clwxjlWxxm?: string; // 维修项目
  clwxjlWxfy?: number; // 维修费用
  clwxjlWxslc?: number; // 维修时里程
  createByName?: string; // 创建人
  updateByName?: string; // 修改人
}

export const coreClwxjlList = (params?: CoreClwxjl | any) =>
  defHttp.get<CoreClwxjl>({ url: adminPath + '/cardd/wxjl/coreClwxjl/list', params });

export const coreClwxjlListData = (params?: CoreClwxjl | any) =>
  defHttp.post<Page<CoreClwxjl>>({ url: adminPath + '/cardd/wxjl/coreClwxjl/listData', params });

export const coreClwxjlForm = (params?: CoreClwxjl | any) =>
  defHttp.get<CoreClwxjl>({ url: adminPath + '/cardd/wxjl/coreClwxjl/form', params });

export const coreClwxjlSave = (params?: any, data?: CoreClwxjl | any) =>
  defHttp.postJson<CoreClwxjl>({ url: adminPath + '/cardd/wxjl/coreClwxjl/save', params, data });

export const coreClwxjlImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/cardd/wxjl/coreClwxjl/importData',
      onUploadProgress,
    },
    params,
  );

export const coreClwxjlDelete = (params?: CoreClwxjl | any) =>
  defHttp.get<CoreClwxjl>({ url: adminPath + '/cardd/wxjl/coreClwxjl/delete', params });
